package serveur;

import java.rmi.RemoteException;
import java.rmi.server.RMIClientSocketFactory;
import java.rmi.server.RMIServerSocketFactory;
import java.rmi.server.UnicastRemoteObject;
import java.util.List;
import java.util.Set;


@SuppressWarnings("serial")
public class ServiceCommunImpl extends UnicastRemoteObject implements
		ServiceCommunRemote {
	
	private TwitterDistant twitter;

	public ServiceCommunImpl() throws RemoteException {
	}

	public ServiceCommunImpl(TwitterDistant twitter, int port) throws RemoteException {
		super(port);
		this.twitter = twitter;
	}
	
	public ServiceCommunImpl(int port) throws RemoteException {
		super(port);
	}

	public ServiceCommunImpl(int port, RMIClientSocketFactory csf,
			RMIServerSocketFactory ssf) throws RemoteException {
		super(port, csf, ssf);
	}

	@Override
	public Set<String> getUtilisateurs() throws RemoteException {
		return twitter.getUtilisateurs();
	}

	@Override
	public Set<String> getTopics() throws RemoteException {
		return twitter.getTopics();
	}

	@Override
	public List<Tweet> getTweetsParUtilisateur(String pseudo)
			throws RemoteException {
		return twitter.getTweetsParUtilisateur(pseudo);
	}

	@Override
	public List<Tweet> getTweetsParTopic(String topic) throws RemoteException {
		return twitter.getTweetsParTopic(topic);
	}

}
